# various colour constants as rgb triples

BLACK =     (0x00, 0x00, 0x00)
RED =         (0xFF, 0x00, 0x00)
GREEN =     (0x00, 0xFF, 0x00)
BLUE =         (0x00, 0x00, 0xFF)
WHITE =     (0xFF, 0xFF, 0xFF)
NAVY =         (0x00, 0x00, 0x80)

ORANGE =    (0xFF, 0xA5, 0x00)
LINEN =     (250, 240, 230)
PINK =         (255, 192, 203)
GOLD =         (255, 215, 0)
BLUEBLACK = (0x00, 0x00, 0x40)

# return the triple which is the middle point of the two given
# untested
def average(c1, c2):
    d_red = int((c1[0] - c2[0])//2)
    d_green = int((c1[1] - c2[1])//2)
    d_blue = int((c1[2] - c2[2])//2)
    
    return (c1[0] + d_red, c1[1] + d_green, c1[2] + d_blue)

# return the triple which is between the two colour
# ratio will be between 0 and 1
def ratio(from_colour, to_colour, ratio):
    d_red = int((from_colour[0] - to_colour[0]) * ratio)
    d_green = int((from_colour[1] - to_colour[1]) * ratio)
    d_blue = int((from_colour[2] - to_colour[2]) * ratio)
    
    return (from_colour[0] - d_red, from_colour[1] - d_green, from_colour[2] - d_blue)